package Scuttlebutt;

import java.awt.event.*;
import javax.swing.*;
import javax.swing.filechooser.*;
import java.io.*;
import glue.*;

public class EventNewProject extends JMenuItem implements ActionListener 
{
	Scuttlebutt parent = null;
	
	public EventNewProject(Scuttlebutt parent)
	{
		this.parent = parent;
		addActionListener(this);
	}
	
	public EventNewProject(String text, Scuttlebutt parent)
	{
		super(text);
		this.parent = parent;
		addActionListener(this);
	}


	public void actionPerformed(ActionEvent a0)
	{
    	NewProjectDlg projectDlg = new NewProjectDlg(parent,"New Project...",  true);
    	projectDlg.setVisible(true);
    	if(projectDlg.getState()){
    		parent.newProject(projectDlg.getProjectName(), projectDlg.getProjectPath(), projectDlg.getAddress(), projectDlg.getPort(), projectDlg.getUsername(), projectDlg.getPassword(), projectDlg.synchronizeBox.getModel().isSelected());
		}
	}
}

